<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Iqbal's Server <?php echo $_SERVER['HTTP_HOST']; ?></title>
	<link href="_style/style.css" rel="stylesheet" type="text/css" />
	<style type="text/css" media="screen">
		#container a[href^="http:"] {
			background: transparent url("_images/external_link.gif") no-repeat 100% 50%;
			padding-right: 10px;
			white-space: nowrap;
				}
		#container a:hover[href^="http:"] {
			background: #F3F4EC url("_images/external_link.gif") no-repeat 100% 50%;
		}
	</style>
</head>
<body>

	<div id="container">
		Well, Thanks for visiting <a href="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>">http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?></a>.<br />
		This is the development Server.<br />
		Click on the links below to check the applications :
		<br /><br />
		<hr />
		<ol>
			<?php
			if ($handle = opendir('.')) {
				while (false !== ($file = readdir($handle))) { 
					if ($file != "." && $file != "..") { 
						if ((substr($file, 0, 1) !== '_') && ($file !== 'index.php')) {
							$arr_nama_file = explode('_', $file);
							foreach ($arr_nama_file as $key => $value) {
								if (strlen($value) > 4)
									$arr_nama_file[$key] = ucfirst($value);
								else
									$arr_nama_file[$key] = strtoupper($value);
							}
							$str_nama_file = implode(' ', $arr_nama_file);

							$desc_path = $file. '/desc.txt';

							if (file_exists($desc_path)) {
								$desc_handle = fopen ($desc_path, "r");
								$desc_content = fread ($desc_handle, filesize ($desc_path));
								fclose ($desc_handle);

								?>
									<li><a href="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $file; ?>/"><?php echo $str_nama_file; ?></a></li>
									<p><?php echo $desc_content; ?></p>
								<?php
							} else {
								?>
									<li><a href="http://<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $file; ?>/"><?php echo $str_nama_file; ?></a></li>
								<?php
							}
						}
					} 
				}
				closedir($handle); 
			}
			?>
		</ol>
		<br />
		<hr />
		<br />
<!-- 		<p>
		Found the application that you've looking for..?<br />
		No...?<br />
		Well.. Try somebody else's Development Server then..</p>
		<p>Or.. Click <a href="http://www.google.com/">here</a> to go somewhere fun.</p> -->
		<br />
	</div>

</body>
</html>